# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time        : 2021/9/17 20:04
@Author      : Albert Darren
@Contact     : 2563491540@qq.com
@File        : pil_downsample.py
@Version     : Version 1.0.0
@Description : TODO
@Created By  : PyCharm
"""
from PIL import Image
from matplotlib import pyplot as plt
from matplotlib import font_manager

my_font = font_manager.FontProperties(fname="C:/Windows/Fonts/simhei.ttf")
im = Image.open('./../experiment_fig/aio.jpg')
down_sample_fig1 = im.resize(size=(im.width // 5, im.height // 5))
plt.subplot(1, 2, 1)
plt.title("不使用ANTIALIAS", fontproperties=my_font)
plt.imshow(down_sample_fig1)
down_sample_fig2 = im.resize(size=(im.width // 5, im.height // 5),
                             resample=Image.ANTIALIAS)
plt.subplot(1, 2, 2)
plt.title("使用ANTIALIAS", fontproperties=my_font)
plt.imshow(down_sample_fig2)
plt.show()
